.class public abstract Lcom/openfeint/internal/resource/Resource;
.super Ljava/lang/Object;
.source "Resource.java"


# static fields
.field private static final TAG:Ljava/lang/String; = "Resource"

.field private static sNameMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lcom/openfeint/internal/resource/ResourceClass;",
            ">;"
        }
    .end annotation
.end field

.field private static sSubclassMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/Class",
            "<+",
            "Lcom/openfeint/internal/resource/Resource;",
            ">;",
            "Lcom/openfeint/internal/resource/ResourceClass;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field mID:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 30
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/openfeint/internal/resource/Resource;->sSubclassMap:Ljava/util/HashMap;

    .line 31
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/openfeint/internal/resource/Resource;->sNameMap:Ljava/util/HashMap;

    .line 166
    invoke-static {}, Lcom/openfeint/internal/resource/Resource;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 167
    invoke-static {}, Lcom/openfeint/internal/resource/ServerException;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 168
    invoke-static {}, Lcom/openfeint/api/resource/ServerTimestamp;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 169
    invoke-static {}, Lcom/openfeint/internal/resource/BlobUploadParameters;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 171
    invoke-static {}, Lcom/openfeint/api/resource/Achievement;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 172
    invoke-static {}, Lcom/openfeint/api/resource/Leaderboard;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 173
    invoke-static {}, Lcom/openfeint/api/resource/Score;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 174
    invoke-static {}, Lcom/openfeint/api/resource/User;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 177
    invoke-static {}, Lcom/openfeint/api/resource/CurrentUser;->getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v0

    invoke-static {v0}, Lcom/openfeint/internal/resource/Resource;->registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V

    .line 23
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getKlass(Ljava/lang/Class;)Lcom/openfeint/internal/resource/ResourceClass;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Class",
            "<*>;)",
            "Lcom/openfeint/internal/resource/ResourceClass;"
        }
    .end annotation

    .prologue
    .line 41
    .local p0, subclass:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    sget-object v0, Lcom/openfeint/internal/resource/Resource;->sSubclassMap:Ljava/util/HashMap;

    invoke-virtual {v0, p0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0           #subclass:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    check-cast p0, Lcom/openfeint/internal/resource/ResourceClass;

    return-object p0
.end method

.method public static getKlass(Ljava/lang/String;)Lcom/openfeint/internal/resource/ResourceClass;
    .locals 1
    .parameter "klassName"

    .prologue
    .line 45
    sget-object v0, Lcom/openfeint/internal/resource/Resource;->sNameMap:Ljava/util/HashMap;

    invoke-virtual {v0, p0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/openfeint/internal/resource/ResourceClass;

    return-object p0
.end method

.method public static getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;
    .locals 4

    .prologue
    .line 50
    new-instance v0, Lcom/openfeint/internal/resource/Resource$1;

    const-class v1, Lcom/openfeint/internal/resource/Resource;

    const/4 v2, 0x0

    invoke-direct {v0, v1, v2}, Lcom/openfeint/internal/resource/Resource$1;-><init>(Ljava/lang/Class;Ljava/lang/String;)V

    .line 51
    .local v0, klass:Lcom/openfeint/internal/resource/ResourceClass;
    iget-object v1, v0, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    const-string v2, "id"

    new-instance v3, Lcom/openfeint/internal/resource/Resource$2;

    invoke-direct {v3}, Lcom/openfeint/internal/resource/Resource$2;-><init>()V

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 52
    return-object v0
.end method

.method public static registerSubclass(Lcom/openfeint/internal/resource/ResourceClass;)V
    .locals 2
    .parameter "klass"

    .prologue
    .line 34
    sget-object v0, Lcom/openfeint/internal/resource/Resource;->sSubclassMap:Ljava/util/HashMap;

    iget-object v1, p0, Lcom/openfeint/internal/resource/ResourceClass;->mObjectClass:Ljava/lang/Class;

    invoke-virtual {v0, v1, p0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 35
    iget-object v0, p0, Lcom/openfeint/internal/resource/ResourceClass;->mResourceName:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 36
    sget-object v0, Lcom/openfeint/internal/resource/Resource;->sNameMap:Ljava/util/HashMap;

    iget-object v1, p0, Lcom/openfeint/internal/resource/ResourceClass;->mResourceName:Ljava/lang/String;

    invoke-virtual {v0, v1, p0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 38
    :cond_0
    return-void
.end method

.method private final unguardedShallowCopy(Lcom/openfeint/internal/resource/Resource;)V
    .locals 7
    .parameter "otherResource"

    .prologue
    .line 150
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    invoke-static {v4}, Lcom/openfeint/internal/resource/Resource;->getKlass(Ljava/lang/Class;)Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v2

    .line 151
    .local v2, rc:Lcom/openfeint/internal/resource/ResourceClass;
    iget-object v4, v2, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    invoke-virtual {v4}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :cond_0
    :goto_0
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_1

    .line 161
    return-void

    .line 151
    :cond_1
    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map$Entry;

    .line 152
    .local v1, e:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Lcom/openfeint/internal/resource/ResourceProperty;>;"
    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/openfeint/internal/resource/ResourceProperty;

    .line 153
    .local v3, rp:Lcom/openfeint/internal/resource/ResourceProperty;
    instance-of v4, v3, Lcom/openfeint/internal/resource/PrimitiveResourceProperty;

    if-eqz v4, :cond_2

    .line 154
    check-cast v3, Lcom/openfeint/internal/resource/PrimitiveResourceProperty;

    .end local v3           #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    invoke-virtual {v3, p0, p1}, Lcom/openfeint/internal/resource/PrimitiveResourceProperty;->copy(Lcom/openfeint/internal/resource/Resource;Lcom/openfeint/internal/resource/Resource;)V

    goto :goto_0

    .line 155
    .restart local v3       #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    :cond_2
    instance-of v4, v3, Lcom/openfeint/internal/resource/ArrayResourceProperty;

    if-eqz v4, :cond_3

    .line 156
    move-object v0, v3

    check-cast v0, Lcom/openfeint/internal/resource/ArrayResourceProperty;

    move-object v4, v0

    check-cast v3, Lcom/openfeint/internal/resource/ArrayResourceProperty;

    .end local v3           #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    invoke-virtual {v3, p1}, Lcom/openfeint/internal/resource/ArrayResourceProperty;->get(Lcom/openfeint/internal/resource/Resource;)Ljava/util/List;

    move-result-object v6

    invoke-virtual {v4, p0, v6}, Lcom/openfeint/internal/resource/ArrayResourceProperty;->set(Lcom/openfeint/internal/resource/Resource;Ljava/util/List;)V

    goto :goto_0

    .line 157
    .restart local v3       #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    :cond_3
    instance-of v4, v3, Lcom/openfeint/internal/resource/NestedResourceProperty;

    if-eqz v4, :cond_0

    .line 158
    move-object v0, v3

    check-cast v0, Lcom/openfeint/internal/resource/NestedResourceProperty;

    move-object v4, v0

    check-cast v3, Lcom/openfeint/internal/resource/NestedResourceProperty;

    .end local v3           #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    invoke-virtual {v3, p1}, Lcom/openfeint/internal/resource/NestedResourceProperty;->get(Lcom/openfeint/internal/resource/Resource;)Lcom/openfeint/internal/resource/Resource;

    move-result-object v6

    invoke-virtual {v4, p0, v6}, Lcom/openfeint/internal/resource/NestedResourceProperty;->set(Lcom/openfeint/internal/resource/Resource;Lcom/openfeint/internal/resource/Resource;)V

    goto :goto_0
.end method


# virtual methods
.method public final generate()Ljava/lang/String;
    .locals 6

    .prologue
    .line 63
    new-instance v3, Ljava/io/StringWriter;

    invoke-direct {v3}, Ljava/io/StringWriter;-><init>()V

    .line 64
    .local v3, sw:Ljava/io/StringWriter;
    new-instance v1, Lorg/codehaus/jackson/JsonFactory;

    invoke-direct {v1}, Lorg/codehaus/jackson/JsonFactory;-><init>()V

    .line 66
    .local v1, jf:Lorg/codehaus/jackson/JsonFactory;
    :try_start_0
    invoke-virtual {v1, v3}, Lorg/codehaus/jackson/JsonFactory;->createJsonGenerator(Ljava/io/Writer;)Lorg/codehaus/jackson/JsonGenerator;

    move-result-object v2

    .line 67
    .local v2, jg:Lorg/codehaus/jackson/JsonGenerator;
    invoke-virtual {p0, v2}, Lcom/openfeint/internal/resource/Resource;->generate(Lorg/codehaus/jackson/JsonGenerator;)V

    .line 68
    invoke-virtual {v2}, Lorg/codehaus/jackson/JsonGenerator;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 73
    invoke-virtual {v3}, Ljava/io/StringWriter;->toString()Ljava/lang/String;

    move-result-object v4

    .end local v2           #jg:Lorg/codehaus/jackson/JsonGenerator;
    :goto_0
    return-object v4

    .line 69
    :catch_0
    move-exception v4

    move-object v0, v4

    .line 70
    .local v0, e:Ljava/io/IOException;
    const-string v4, "Resource"

    invoke-virtual {v0}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/openfeint/internal/OpenFeintInternal;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 71
    const/4 v4, 0x0

    goto :goto_0
.end method

.method public final generate(Lorg/codehaus/jackson/JsonGenerator;)V
    .locals 13
    .parameter "generator"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/codehaus/jackson/JsonGenerationException;,
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 77
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v10

    invoke-static {v10}, Lcom/openfeint/internal/resource/Resource;->getKlass(Ljava/lang/Class;)Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v7

    .line 78
    .local v7, rc:Lcom/openfeint/internal/resource/ResourceClass;
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeStartObject()V

    .line 79
    iget-object v10, v7, Lcom/openfeint/internal/resource/ResourceClass;->mResourceName:Ljava/lang/String;

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeFieldName(Ljava/lang/String;)V

    .line 80
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeStartObject()V

    .line 81
    iget-object v10, v7, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    invoke-virtual {v10}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v10

    invoke-interface {v10}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v11

    :cond_0
    :goto_0
    invoke-interface {v11}, Ljava/util/Iterator;->hasNext()Z

    move-result v10

    if-nez v10, :cond_1

    .line 122
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeEndObject()V

    .line 123
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeEndObject()V

    .line 124
    return-void

    .line 81
    :cond_1
    invoke-interface {v11}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map$Entry;

    .line 82
    .local v2, e:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Lcom/openfeint/internal/resource/ResourceProperty;>;"
    invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/openfeint/internal/resource/ResourceProperty;

    .line 83
    .local v9, rp:Lcom/openfeint/internal/resource/ResourceProperty;
    instance-of v10, v9, Lcom/openfeint/internal/resource/PrimitiveResourceProperty;

    if-eqz v10, :cond_2

    .line 84
    check-cast v9, Lcom/openfeint/internal/resource/PrimitiveResourceProperty;

    .end local v9           #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/String;

    invoke-virtual {v9, p0, p1, v10}, Lcom/openfeint/internal/resource/PrimitiveResourceProperty;->generate(Lcom/openfeint/internal/resource/Resource;Lorg/codehaus/jackson/JsonGenerator;Ljava/lang/String;)V

    goto :goto_0

    .line 85
    .restart local v9       #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    :cond_2
    instance-of v10, v9, Lcom/openfeint/internal/resource/ArrayResourceProperty;

    if-eqz v10, :cond_4

    .line 86
    move-object v0, v9

    check-cast v0, Lcom/openfeint/internal/resource/ArrayResourceProperty;

    move-object v1, v0

    .line 87
    .local v1, arp:Lcom/openfeint/internal/resource/ArrayResourceProperty;
    invoke-virtual {v1, p0}, Lcom/openfeint/internal/resource/ArrayResourceProperty;->get(Lcom/openfeint/internal/resource/Resource;)Ljava/util/List;

    move-result-object v8

    .line 88
    .local v8, resources:Ljava/util/List;,"Ljava/util/List<+Lcom/openfeint/internal/resource/Resource;>;"
    if-eqz v8, :cond_0

    .line 89
    invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/String;

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeFieldName(Ljava/lang/String;)V

    .line 90
    invoke-virtual {v1}, Lcom/openfeint/internal/resource/ArrayResourceProperty;->elementType()Ljava/lang/Class;

    move-result-object v10

    invoke-static {v10}, Lcom/openfeint/internal/resource/Resource;->getKlass(Ljava/lang/Class;)Lcom/openfeint/internal/resource/ResourceClass;

    move-result-object v4

    .line 92
    .local v4, erc:Lcom/openfeint/internal/resource/ResourceClass;
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeStartObject()V

    .line 93
    new-instance v10, Ljava/lang/StringBuilder;

    iget-object v12, v4, Lcom/openfeint/internal/resource/ResourceClass;->mResourceName:Ljava/lang/String;

    invoke-static {v12}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v12

    invoke-direct {v10, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v12, "s"

    invoke-virtual {v10, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeFieldName(Ljava/lang/String;)V

    .line 94
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeStartArray()V

    .line 96
    invoke-interface {v8}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v10

    :goto_1
    invoke-interface {v10}, Ljava/util/Iterator;->hasNext()Z

    move-result v12

    if-nez v12, :cond_3

    .line 100
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeEndArray()V

    .line 101
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeEndObject()V

    goto :goto_0

    .line 96
    :cond_3
    invoke-interface {v10}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/openfeint/internal/resource/Resource;

    .line 97
    .local v5, r:Lcom/openfeint/internal/resource/Resource;
    invoke-virtual {v5, p1}, Lcom/openfeint/internal/resource/Resource;->generate(Lorg/codehaus/jackson/JsonGenerator;)V

    goto :goto_1

    .line 103
    .end local v1           #arp:Lcom/openfeint/internal/resource/ArrayResourceProperty;
    .end local v4           #erc:Lcom/openfeint/internal/resource/ResourceClass;
    .end local v5           #r:Lcom/openfeint/internal/resource/Resource;
    .end local v8           #resources:Ljava/util/List;,"Ljava/util/List<+Lcom/openfeint/internal/resource/Resource;>;"
    :cond_4
    instance-of v10, v9, Lcom/openfeint/internal/resource/NestedResourceProperty;

    if-eqz v10, :cond_5

    .line 104
    check-cast v9, Lcom/openfeint/internal/resource/NestedResourceProperty;

    .end local v9           #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    invoke-virtual {v9, p0}, Lcom/openfeint/internal/resource/NestedResourceProperty;->get(Lcom/openfeint/internal/resource/Resource;)Lcom/openfeint/internal/resource/Resource;

    move-result-object v5

    .line 105
    .restart local v5       #r:Lcom/openfeint/internal/resource/Resource;
    if-eqz v5, :cond_0

    .line 106
    invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/String;

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeFieldName(Ljava/lang/String;)V

    .line 107
    invoke-virtual {v5, p1}, Lcom/openfeint/internal/resource/Resource;->generate(Lorg/codehaus/jackson/JsonGenerator;)V

    goto/16 :goto_0

    .line 109
    .end local v5           #r:Lcom/openfeint/internal/resource/Resource;
    .restart local v9       #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    :cond_5
    instance-of v10, v9, Lcom/openfeint/internal/resource/HashIntResourceProperty;

    if-eqz v10, :cond_0

    .line 110
    check-cast v9, Lcom/openfeint/internal/resource/HashIntResourceProperty;

    .end local v9           #rp:Lcom/openfeint/internal/resource/ResourceProperty;
    invoke-virtual {v9, p0}, Lcom/openfeint/internal/resource/HashIntResourceProperty;->get(Lcom/openfeint/internal/resource/Resource;)Ljava/util/HashMap;

    move-result-object v6

    .line 111
    .local v6, r:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Integer;>;"
    if-eqz v6, :cond_0

    invoke-virtual {v6}, Ljava/util/HashMap;->size()I

    move-result v10

    if-lez v10, :cond_0

    .line 112
    invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/String;

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeFieldName(Ljava/lang/String;)V

    .line 113
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeStartObject()V

    .line 114
    invoke-virtual {v6}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v10

    invoke-interface {v10}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v12

    :goto_2
    invoke-interface {v12}, Ljava/util/Iterator;->hasNext()Z

    move-result v10

    if-nez v10, :cond_6

    .line 118
    invoke-virtual {p1}, Lorg/codehaus/jackson/JsonGenerator;->writeEndObject()V

    goto/16 :goto_0

    .line 114
    :cond_6
    invoke-interface {v12}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/Map$Entry;

    .line 115
    .local v3, entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/Integer;>;"
    invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/String;

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeFieldName(Ljava/lang/String;)V

    .line 116
    invoke-interface {v3}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/Integer;

    invoke-virtual {v10}, Ljava/lang/Integer;->intValue()I

    move-result v10

    invoke-virtual {p1, v10}, Lorg/codehaus/jackson/JsonGenerator;->writeNumber(I)V

    goto :goto_2
.end method

.method public final generateToStream(Ljava/io/OutputStream;)V
    .locals 3
    .parameter "out"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 56
    new-instance v0, Lorg/codehaus/jackson/JsonFactory;

    invoke-direct {v0}, Lorg/codehaus/jackson/JsonFactory;-><init>()V

    .line 57
    .local v0, jf:Lorg/codehaus/jackson/JsonFactory;
    sget-object v2, Lorg/codehaus/jackson/JsonEncoding;->UTF8:Lorg/codehaus/jackson/JsonEncoding;

    invoke-virtual {v0, p1, v2}, Lorg/codehaus/jackson/JsonFactory;->createJsonGenerator(Ljava/io/OutputStream;Lorg/codehaus/jackson/JsonEncoding;)Lorg/codehaus/jackson/JsonGenerator;

    move-result-object v1

    .line 58
    .local v1, jg:Lorg/codehaus/jackson/JsonGenerator;
    invoke-virtual {p0, v1}, Lcom/openfeint/internal/resource/Resource;->generate(Lorg/codehaus/jackson/JsonGenerator;)V

    .line 59
    invoke-virtual {v1}, Lorg/codehaus/jackson/JsonGenerator;->close()V

    .line 60
    return-void
.end method

.method public resourceID()Ljava/lang/String;
    .locals 1

    .prologue
    .line 27
    iget-object v0, p0, Lcom/openfeint/internal/resource/Resource;->mID:Ljava/lang/String;

    return-object v0
.end method

.method public setResourceID(Ljava/lang/String;)V
    .locals 0
    .parameter "id"

    .prologue
    .line 28
    iput-object p1, p0, Lcom/openfeint/internal/resource/Resource;->mID:Ljava/lang/String;

    return-void
.end method

.method public final shallowCopy(Lcom/openfeint/internal/resource/Resource;)V
    .locals 2
    .parameter "otherResource"

    .prologue
    .line 127
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    if-eq v0, v1, :cond_0

    .line 128
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "You can only shallowCopy the same type of resource"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 131
    :cond_0
    invoke-direct {p0, p1}, Lcom/openfeint/internal/resource/Resource;->unguardedShallowCopy(Lcom/openfeint/internal/resource/Resource;)V

    .line 132
    return-void
.end method

.method public final shallowCopyAncestorType(Lcom/openfeint/internal/resource/Resource;)V
    .locals 5
    .parameter "otherResource"

    .prologue
    .line 135
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    .line 136
    .local v0, c:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    .line 137
    .local v1, o:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    const-class v2, Lcom/openfeint/internal/resource/Resource;

    if-eq v1, v2, :cond_2

    .line 138
    :goto_0
    if-eq v0, v1, :cond_0

    const-class v2, Lcom/openfeint/internal/resource/Resource;

    if-ne v0, v2, :cond_1

    .line 141
    :cond_0
    const-class v2, Lcom/openfeint/internal/resource/Resource;

    if-ne v0, v2, :cond_2

    .line 142
    new-instance v2, Ljava/lang/UnsupportedOperationException;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, " is not a superclass of "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 139
    :cond_1
    invoke-virtual {v0}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;

    move-result-object v0

    goto :goto_0

    .line 146
    :cond_2
    invoke-direct {p0, p1}, Lcom/openfeint/internal/resource/Resource;->unguardedShallowCopy(Lcom/openfeint/internal/resource/Resource;)V

    .line 147
    return-void
.end method
